home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 16 / AMIGAplus Sonderheft 16 (1998)(ICP)(DE)[!].iso / pd / spiele / zebulon / src / sitroom.t < prev    next >
Text File  |  1997-01-14  |  11KB  |  346 lines

  1. /* $Id: sitroom.t 1.10 96/04/16 21:56:46 mol Exp $
  2.  **********************************************************************
  3.  *
  4.  * Uncle Zebulon's Will, version 2.0
  5.  *
  6.  * An adventure game, written in TADS 2.2.
  7.  *
  8.  * sitroom.t - The Sitting Room and related objects and puzzles
  9.  *
  10.  **********************************************************************
  11.  * 
  12.  * Copyright (c) 1995-96 by Magnus Olsson (mol@df.lth.se).
  13.  * All rights reserved.
  14.  *
  15.  * This source code may be copied and distributed freely as long as the 
  16.  * following conditions are met:
  17.  *   - no fee may be charged for the code (a nominal fee may be charged
  18.  *     to cover distribution costs)
  19.  *   - the code is not modified in any way
  20.  *   - this copyright notice is not removed or modified in any way
  21.  *
  22.  * You may use individual parts of this code in your programs
  23.  * as long as they are attributed to the author. You are not allowed
  24.  * to use the plot, story, characters or text of the game without the
  25.  * written permission of the author.
  26.  *
  27.  ***********************************************************************/
  28.  
  29. sitting_room : indoors
  30.     noun = 'sitting-room'
  31.     sdesc = "Sitting room"
  32.     ldesc = "After your relatives have gone over it, uncle Zebulon's 
  33.     sitting room looks curiously empty. Most of the furniture has 
  34.     been removed. Of all the things that used to give the room 
  35.     its atmosphere, just a few, obviously not very valuable ones, 
  36.     remain: the old armchair where you used to sit and watch uncle 
  37.     Zebulon entertain you with his magic (or \"conjuring tricks\", 
  38.     as your down-to-earth parents preferred to call it), your uncle's pipe rack, 
  39.     the large mirror on the north wall. "
  40.     west = hall
  41.     north = mirror
  42.     in = {
  43.      askdo;
  44.     }
  45. ;
  46.  
  47. pipe_rack : decoration
  48.     noun = 'rack' 'pipe'
  49.     adjective = 'uncle\'s' 'pipe'
  50.     sdesc = "pipe rack"
  51.     ldesc = "It's empty. Apparently, there's a keen smoker among
  52.         your relatives. "
  53.     location = sitting_room
  54. ;
  55.  
  56. /*
  57.  * Modify inVerb so "walk through mirror" means the same as
  58.  * "enter mirror". This will have the side effect of allowing,
  59.  * say, "walk through porch", but we can live with that.
  60.  */
  61. modify inVerb
  62.     verb = 'walk through' 'go through' 'go into'
  63. ;
  64.  
  65. mirror : fixeditem, obstacle
  66.     noun = 'mirror' 'glass' 'frame' 
  67.     adjective = 'large' 'looking'
  68.     sdesc = "mirror"
  69.     ldesc = {
  70.         if (isopen) {
  71.         "The glass has disappeared from the mirror, leaving just
  72.         an empty frame. Well, not quite empty, there's something
  73.         like the wall of a soap bubble, or a water surface, only
  74.         infinitely thinner - perhaps the interface between two
  75.         universes? ";
  76.         if (not moor_gnittis.isseen)
  77.             "Anyway, it would be possible for you to fulfil your 
  78.         old dream of walking through the mirror now... ";
  79.     }
  80.     else
  81.         "You're a bit surprised that your relatives left this 
  82.             mirror behind, since it's probably quite valuable, or at least
  83.            old. Perhaps its size has something to do with it: it's almost
  84.         a metre wide and taller than you are. When you were a kid you
  85.         used to fantasize about this being a magic mirror, and you
  86.         imagined that when looking into it you could see into another
  87.         world. ";
  88.     }        
  89.  
  90.     isopen = nil
  91.  
  92.     no_all(verb, prep, io) = {
  93.         return (verb = inVerb and not isopen);
  94.     }
  95.     
  96.     destination = {
  97.         if (isopen) {
  98.         "Feeling like Alice in Wonderland, you step through the
  99.         empty mirror frame. A curious wrenching sensation passes
  100.         through your body, as if you've been disassembled into atoms
  101.         and then rapidly put together again. ";
  102.         "\b";
  103.         return moor_gnittis;
  104.     }
  105.     else
  106.             return sitting_room.noexit;
  107.     }
  108.     
  109.     verDoEnter(actor) = { }
  110.     doEnter(actor) = {
  111.         if (isopen)
  112.         actor.travelTo(self.destination);
  113.     else    
  114.             "Alas, it's only in fairy tales that one can walk through 
  115.            mirrors. ";
  116.     }
  117.  
  118.     wand_effect = {
  119.         if (not isopen) {
  120.         ". Amazingly, the stars seem to pass straight through the 
  121.         mirror. They strike your mirror image, which is standing 
  122.         there with a wand in its hand, looking at you with a slightly
  123.         silly expression. With a strange, tearing sound, your
  124.         mirror image wavers and disappears.\n\t
  125.         Shocked, you look again. Sure, you can see the mirror image
  126.         of the room, and everything in it, but not your own image.
  127.         You take a quick look down at yourself, just to check -
  128.         yes, you're still visible. Running up to 
  129.         check the mirror, you realize that the glass is gone; the 
  130.         empty frame forms a portal into a room behind, where no
  131.         room ought to be. ";
  132.  
  133.         incscore(10);
  134.          isopen := true;
  135.         addword(self, &noun, 'portal');
  136.         addword(self, &noun, 'hole');
  137.     }
  138.     else 
  139.         ", which pass through the empty frame into the room
  140.         beyond, exploding with little popping noises. ";
  141.     }
  142.  
  143.     verDoLookin(actor) = { }
  144.     doLookin(actor) = {
  145.         if (isopen)
  146.         "You see a room on the other side of the mirror, a 
  147.         room that seems exactly like the one you're standing 
  148.         in - but with north and south reversed. ";
  149.     else
  150.             "The glass is old and slightly flawed, so the image isn't as
  151.            crisp as you'd expect from a newer mirror. Your reflection looks
  152.         like you, yet somehow like a different person, more cynical,
  153.         with a slightly cunning look. The old glass makes it hard
  154.         to make out all the detail, but the reflection of the room behind
  155.         you looks slightly different, too. ";
  156.     }
  157.     verDoLookthru(actor) = { 
  158.         self.verDoLookin(actor);
  159.     }
  160.     doLookthru(actor) = { 
  161.         self.doLookin(actor);
  162.     }
  163.     verDoLookbehind(actor) = {
  164.         "You can't look behind the mirror; 
  165.     it's fastened flush to the wall. ";
  166.     }
  167.     verDoTake(actor) = {
  168.         "The mirror is securely fastened to the wall. ";
  169.     }
  170.     location = sitting_room
  171. ;
  172.  
  173. /*
  174.  * The armchair is a seachHider, since a wand is hidden inside it,
  175.  * but with the extra twist that you can find the wand by sitting on
  176.  * it as well.
  177.  */
  178. armchair : chairitem, searchHider
  179.     noun = 'armchair' 'arm chair' 'chair' 'furniture'
  180.     adjective = 'old' 'large' 'comfy' 'comfortable' 'battered' 'fave'
  181.     sdesc = "armchair" 
  182.     ldesc = {
  183.         "It may not be a great looker, but this battered old armchair
  184.         has always been your fave piece of furniture. On stormy autumn
  185.     nights you'd relax in its comfy depths, cosy in front of the 
  186.     roaring fire, while your uncle would tell you the most hair-raising
  187.     ghost stories or entertain you with some magic tricks (which you
  188.     steadfastly insisted were real magic, even though your parents 
  189.     tried hard to convince you they were just sleight of hand). ";
  190.     
  191.     if (not self.visited) {
  192.         "\n\tEven today, a decade later, you feel an almost irresistible 
  193.         urge to sit in that armchair once more, just to recall the 
  194.         feeling of those long-gone days. ";
  195.     }
  196.     }
  197.     
  198.     autoTake = nil
  199.     location = sitting_room
  200.     visited = nil // true if player has sat on it.
  201.     
  202.     searchObj(actor, list) = {
  203.         local found := list;
  204.     
  205.     list := nil;
  206.         if (length(found) > 0) {
  207.         local obj := car(found);
  208.         
  209.         "You find << obj.adesc >> hidden deep inside the armchair. ";
  210.         obj.found := true;
  211.         obj.moveInto(self);
  212.         setit(obj);
  213.     }
  214.     return nil;
  215.     }
  216.  
  217.     doSearch(actor) = {
  218.     if (self.searchCont = nil)
  219.         "You search for a while, but find nothing else hidden
  220.         in <<self.thedesc>>. ";
  221.     else {
  222.         self.searchCont := self.searchObj(actor, self.searchCont);
  223.         "\b(Don't feel too smug about it, though; I suppose nobody
  224.         could have sat in the armchair without feeling the wand.) ";
  225.     }
  226.     }
  227.     doLookin(actor) = {
  228.     if (self.searchCont = nil)
  229.         pass doLookin;
  230.     else
  231.         self.doSearch(actor);
  232.     }
  233.  
  234.     doSiton(actor) = {
  235.         actor.travelTo(self);
  236.     self.visited := true;
  237.     
  238.     "You lower yourself into the cosy armchair and relax with a
  239.     contented sigh. ";
  240.     
  241.     if (self.searchCont <> nil) {
  242.           "However, it doesn't seem as comfortable as you
  243.         recall it. Strange...\n\t
  244.         After a while, you realize that you're sitting
  245.         on something hard. There seems to be something
  246.         hidden within the armchair. ";
  247.       }
  248.     }    
  249. ;
  250.  
  251. moor_gnittis : indoors
  252.     noun = 'moor-gnittis'
  253.     sdesc = "Moor gnittis"
  254.     ldesc = "Well, what do you call a perfect mirror image of a sitting 
  255.     room?  Superficially, this room looks exactly like its
  256.         counterpart on the other side of the mirror, except for the eerie
  257.         fact that everything's inverted, of course; there's an armchair,
  258.     and a pipe rack, an empty mirror frame on the south wall, and
  259.     a wooden door leading west. "
  260.     west = tower_door_e
  261.     south = mirror2
  262.     noexit = {
  263.         "You could go back through the mirror (to the south), or 
  264.     you could leave via the door (to the west). ";
  265.     return nil;
  266.     }
  267.     firstseen = {
  268.         "\b\tThis room shouldn't be here at all. After all, you've
  269.     seen your uncle's house from the outside many times, and
  270.     it simply isn't large enough to accommodate one more room... ";
  271.     }
  272. ;
  273.  
  274.  
  275. pipe_rack2 : decoration
  276.     noun = 'rack' 'pipe'
  277.     adjective = 'uncle\'s' 'pipe'
  278.     sdesc = "pipe rack"
  279.     ldesc = "It looks exactly like its counterpart on the other side
  280.         of the mirror. "
  281.     location = moor_gnittis
  282. ;
  283.  
  284. mirror2 : fixeditem, obstacle
  285.     noun = 'mirror' 'glass' 'frame' 'hole' 'portal'
  286.     adjective = 'large' 'looking'
  287.     sdesc = "mirror"
  288.     ldesc = "The glass has disappeared from the mirror, leaving just
  289.     an empty frame. Well, not quite empty, there's something
  290.     like the wall of a soap bubble, or a water surface, only
  291.     infinitely thinner - perhaps the interface between two
  292.     universes? "
  293.         
  294.     destination = {
  295.         "Feeling like Alice in Wonderland, you step through the
  296.         empty mirror frame. A curious wrenching sensation passes
  297.         through your body, as if you've been disassembled into atoms
  298.         and then rapidly put together again. ";
  299.  
  300.     "\b";
  301.     return sitting_room;
  302.     }
  303.     
  304.     verDoEnter(actor) = { }
  305.     doEnter(actor) = {
  306.         actor.travelTo(self.destination);
  307.     }
  308.  
  309.     wand_effect = {
  310.         ", which pass through the empty frame into the room
  311.         beyond, where they explode with little popping noises. ";
  312.     }
  313.  
  314.     verDoLookin(actor) = { }
  315.     doLookin(actor) = {
  316.         "You see a room on the other side of the mirror, a 
  317.         room that seems exactly like the one you're standing 
  318.         in - but with north and south reversed. ";
  319.     }
  320.     verDoLookthru(actor) = { 
  321.         self.verDoLookin(actor);
  322.     }
  323.     doLookthru(actor) = { 
  324.         self.doLookin(actor);
  325.     }
  326.     verDoLookbehind(actor) = {
  327.         "You can't look behind the mirror; 
  328.     it's fastened flush to the wall. ";
  329.     }
  330.     verDoTake(actor) = {
  331.         "The mirror is securely fastened to the wall. ";
  332.     }
  333.     location = moor_gnittis
  334. ;
  335.  
  336. armchair2 : decoration
  337.     noun = 'armchair' 'arm chair' 'chair' 'furniture'
  338.     adjective = 'old' 'large' 'comfy' 'comfortable' 'battered' 'fave'
  339.     sdesc = "armchair" 
  340.     ldesc = "It looks exactly as its counterpart on the other side
  341.         of the mirror, only inverted. For example, the large stain
  342.     on the right armrest is on the left one - or is it the
  343.     other way round? "
  344.     location = moor_gnittis
  345. ;
  346.